import 'package:healthy_station_flutter/generated/json/base/json_convert_content.dart';
import 'package:healthy_station_flutter/entity/station_detail_entity.dart';

StationDetailEntity $StationDetailEntityFromJson(Map<String, dynamic> json) {
  final StationDetailEntity stationDetailEntity = StationDetailEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    stationDetailEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    stationDetailEntity.name = name;
  }
  final String? stationLevel = jsonConvert.convert<String>(
      json['stationLevel']);
  if (stationLevel != null) {
    stationDetailEntity.stationLevel = stationLevel;
  }
  final String? orgId = jsonConvert.convert<String>(json['orgId']);
  if (orgId != null) {
    stationDetailEntity.orgId = orgId;
  }
  final String? orgName = jsonConvert.convert<String>(json['orgName']);
  if (orgName != null) {
    stationDetailEntity.orgName = orgName;
  }
  final String? dutyCenterId = jsonConvert.convert<String>(
      json['dutyCenterId']);
  if (dutyCenterId != null) {
    stationDetailEntity.dutyCenterId = dutyCenterId;
  }
  final String? dutyCenterName = jsonConvert.convert<String>(
      json['dutyCenterName']);
  if (dutyCenterName != null) {
    stationDetailEntity.dutyCenterName = dutyCenterName;
  }
  final String? lon = jsonConvert.convert<String>(json['lon']);
  if (lon != null) {
    stationDetailEntity.lon = lon;
  }
  final String? lat = jsonConvert.convert<String>(json['lat']);
  if (lat != null) {
    stationDetailEntity.lat = lat;
  }
  final String? province = jsonConvert.convert<String>(json['province']);
  if (province != null) {
    stationDetailEntity.province = province;
  }
  final String? city = jsonConvert.convert<String>(json['city']);
  if (city != null) {
    stationDetailEntity.city = city;
  }
  final String? region = jsonConvert.convert<String>(json['region']);
  if (region != null) {
    stationDetailEntity.region = region;
  }
  final String? psrStr = jsonConvert.convert<String>(json['psrStr']);
  if (psrStr != null) {
    stationDetailEntity.psrStr = psrStr;
  }
  final String? addr = jsonConvert.convert<String>(json['addr']);
  if (addr != null) {
    stationDetailEntity.addr = addr;
  }
  final String? chargePerson = jsonConvert.convert<String>(
      json['chargePerson']);
  if (chargePerson != null) {
    stationDetailEntity.chargePerson = chargePerson;
  }
  final String? chargePhone = jsonConvert.convert<String>(json['chargePhone']);
  if (chargePhone != null) {
    stationDetailEntity.chargePhone = chargePhone;
  }
  final String? introduction = jsonConvert.convert<String>(
      json['introduction']);
  if (introduction != null) {
    stationDetailEntity.introduction = introduction;
  }
  final String? stationLevelName = jsonConvert.convert<String>(
      json['stationLevelName']);
  if (stationLevelName != null) {
    stationDetailEntity.stationLevelName = stationLevelName;
  }
  final String? machineId = jsonConvert.convert<String>(json['machineId']);
  if (machineId != null) {
    stationDetailEntity.machineId = machineId;
  }
  final String? machineStatus = jsonConvert.convert<String>(
      json['machineStatus']);
  if (machineStatus != null) {
    stationDetailEntity.machineStatus = machineStatus;
  }
  final String? machineType = jsonConvert.convert<String>(json['machineType']);
  if (machineType != null) {
    stationDetailEntity.machineType = machineType;
  }
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    stationDetailEntity.address = address;
  }
  final String? serverIp = jsonConvert.convert<String>(json['serverIp']);
  if (serverIp != null) {
    stationDetailEntity.serverIp = serverIp;
  }
  final String? machineModel = jsonConvert.convert<String>(
      json['machineModel']);
  if (machineModel != null) {
    stationDetailEntity.machineModel = machineModel;
  }
  final String? machineTypeName = jsonConvert.convert<String>(
      json['machineTypeName']);
  if (machineTypeName != null) {
    stationDetailEntity.machineTypeName = machineTypeName;
  }
  final String? machineModelName = jsonConvert.convert<String>(
      json['machineModelName']);
  if (machineModelName != null) {
    stationDetailEntity.machineModelName = machineModelName;
  }
  final String? machineCheckItemName = jsonConvert.convert<String>(
      json['machineCheckItemName']);
  if (machineCheckItemName != null) {
    stationDetailEntity.machineCheckItemName = machineCheckItemName;
  }
  return stationDetailEntity;
}

Map<String, dynamic> $StationDetailEntityToJson(StationDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['stationLevel'] = entity.stationLevel;
  data['orgId'] = entity.orgId;
  data['orgName'] = entity.orgName;
  data['dutyCenterId'] = entity.dutyCenterId;
  data['dutyCenterName'] = entity.dutyCenterName;
  data['lon'] = entity.lon;
  data['lat'] = entity.lat;
  data['province'] = entity.province;
  data['city'] = entity.city;
  data['region'] = entity.region;
  data['psrStr'] = entity.psrStr;
  data['addr'] = entity.addr;
  data['chargePerson'] = entity.chargePerson;
  data['chargePhone'] = entity.chargePhone;
  data['introduction'] = entity.introduction;
  data['stationLevelName'] = entity.stationLevelName;
  data['machineId'] = entity.machineId;
  data['machineStatus'] = entity.machineStatus;
  data['machineType'] = entity.machineType;
  data['address'] = entity.address;
  data['serverIp'] = entity.serverIp;
  data['machineModel'] = entity.machineModel;
  data['machineTypeName'] = entity.machineTypeName;
  data['machineModelName'] = entity.machineModelName;
  data['machineCheckItemName'] = entity.machineCheckItemName;
  return data;
}

extension StationDetailEntityExtension on StationDetailEntity {
  StationDetailEntity copyWith({
    String? id,
    String? name,
    String? stationLevel,
    String? orgId,
    String? orgName,
    String? dutyCenterId,
    String? dutyCenterName,
    String? lon,
    String? lat,
    String? province,
    String? city,
    String? region,
    String? psrStr,
    String? addr,
    String? chargePerson,
    String? chargePhone,
    String? introduction,
    String? stationLevelName,
    String? machineId,
    String? machineStatus,
    String? machineType,
    String? address,
    String? serverIp,
    String? machineModel,
    String? machineTypeName,
    String? machineModelName,
    String? machineCheckItemName,
  }) {
    return StationDetailEntity()
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..stationLevel = stationLevel ?? this.stationLevel
      ..orgId = orgId ?? this.orgId
      ..orgName = orgName ?? this.orgName
      ..dutyCenterId = dutyCenterId ?? this.dutyCenterId
      ..dutyCenterName = dutyCenterName ?? this.dutyCenterName
      ..lon = lon ?? this.lon
      ..lat = lat ?? this.lat
      ..province = province ?? this.province
      ..city = city ?? this.city
      ..region = region ?? this.region
      ..psrStr = psrStr ?? this.psrStr
      ..addr = addr ?? this.addr
      ..chargePerson = chargePerson ?? this.chargePerson
      ..chargePhone = chargePhone ?? this.chargePhone
      ..introduction = introduction ?? this.introduction
      ..stationLevelName = stationLevelName ?? this.stationLevelName
      ..machineId = machineId ?? this.machineId
      ..machineStatus = machineStatus ?? this.machineStatus
      ..machineType = machineType ?? this.machineType
      ..address = address ?? this.address
      ..serverIp = serverIp ?? this.serverIp
      ..machineModel = machineModel ?? this.machineModel
      ..machineTypeName = machineTypeName ?? this.machineTypeName
      ..machineModelName = machineModelName ?? this.machineModelName
      ..machineCheckItemName = machineCheckItemName ??
          this.machineCheckItemName;
  }
}